package com.wjjun.base.utils

import android.content.Context
import android.view.View

/**
 * 对系统类的扩展
 * author : wangjunjun
 * date   : 2022/6/29
 * desc   :
 */
class Spread {
}

fun View.dip2dp(dip: Float): Float {
    val scale: Float = this.resources.displayMetrics.density
    return dip * scale
}

fun Context.dip2dp(dip: Float): Float {
    val scale: Float = this.resources.displayMetrics.density
    return dip * scale
}